from flask import render_template
from mainapp import app
from flask_script import Manager
from mainapp.views import blue01bank, filter01_user

@app.route("/")
def index():
    data = {
        'menus' : ['用户管理','订单管理']
    }
    return render_template('index.html', **data)

if __name__ == '__main__':

    # 将蓝图对象注册到flask服务中
    app.register_blueprint(blue01bank.blue)
    app.register_blueprint(filter01_user.blue, url_prefix='/user')

    # 以脚本的方式启动flask应用服务
    manager = Manager(app)
    manager.run()